/*
 *@author: YangJie
 *@date: 2021-04-07 16:48:13
 *@version:
 *@description:维修保养=>故障报修
 */
 import React, { Component } from 'react';
 import { Table, Button, Form, Tabs ,Input , TreeSelect ,DatePicker,Select,Row,Col, Modal ,Spin} from 'antd';
 import '@/assets/css/settings';
 import * as Utils from '../../utils_yyr/action';
 import { withRouter } from 'react-router-dom';
 import Paging from '../../components_yyr/commponent/Paging';
import moment from 'moment';
import { euqApplicationName, lotAuth, lotAuth2 } from '../../config';
 import 'moment/locale/zh-cn';
 moment.locale('zh-cn')
 
 const nowDate = Utils.getNowDate()
 const { TabPane } = Tabs;
 const {TreeNode} = TreeSelect
 const {Option} = Select
 const { TextArea } = Input
 const FormItem = Form.Item;
 
 class App extends Component {
	 state = {
		 loading: false, //加载中...
		 dataSource: [], //数据源
		 dataSource1: [],
		 drawerVisible: false, //新增修改抽屉的显示与隐藏
		 chooseData: {},
		 drawerTitle: '',
		 total: 0,
		 formValues: {},
		 cityData: [],
		 mainFactoryList: [],
		 selectedData: [],
		 selectedKeys: [],
		 handleType:0,
		 EquTypePageList:[],
		 DepartmentList:[],//部门列表
		 UserList:[],//用户查询
		 jjcd:[],//紧急程度列表
		 wxz:[],
		 visibleEqu :false,
		 loadingTable: false,
		 tableData: [],
		 totalTable:0,
		 formValuesTable:{},
		 selectedDataTable: [],
		 status:0,
		 selectedKeysTable: [],
		 value:1,
		 wxlb:[],
		 zydw:[],
		 wldw:[],
		 visiblePeo:false,
		 equipmentRepairWorkAddDTOList:[],
		 switchChecked:false,
		 selectedDataTable: [],
		 selectedKeysTable:[],
		 totalTablePeo:0,
		 formValuesTablePeo:{},
		 peopleData:[],
		 UserList:[],//用户查询
		 type:0,
		 spining:false
	 };
	 componentDidMount() {
		 this.setState({spining:true})
		this.EquTypePageList()
		this.queryTreeDepartment()
		this.queryPageUser()
		this.jjcd()
		this.wxz()
		this.wxlb()
		this.zydw()
		this.wldw()
		setTimeout(() => {
			this.fetch({
				typeId:2,
				userId:localStorage.getItem('userId')
			});
		}, 150);
		 
	 }
	 //初始化加载数据
	 fetch = (data) => {
		let loc = window.location.href.split('/');
		let id = loc[loc.length-1]
		if(id!=='new'){
			this.setState({type:1})
			let str = ''
			data.ids = id
			for(var key in data){
				if(data[key]){
					str += `&${key}=${data[key]}`
				}
			}
			this.get(euqApplicationName + '/equipmentRepairPlan/findEquipmentRepairPlan?'+str).then(res => {
				let dataaa = res.data
				let objss = dataaa.length===1 ? dataaa[0] : {}
				const arr = [ 'equCode', 'equName','equSpecsModel','equTypeName','deptName','equLocation','equPosition','date_planExeTime','reminderTime','maintenanceCategoryId','urgencyId','maintainTeam','maintainPersons','maintainDays','maintainPerWorkHours','outsource','outsourceHours','remarks','personName']
				let obj = {}
				var newData = []
				if(objss['maintainTeam']){
					let wxz = this.state.wxz
					wxz.forEach((item)=>{
						return item.id == objss['maintainTeam'] && this.setState({UserList:item.userIdList})
					})
	
				}
				if(objss[`maintainPersons`]){
					let arr = objss[`maintainPersons`].split(',')
					console.log(arr)
					console.log(this.state.UserList)
					arr.forEach(item => {
						for(var itemss of this.state.UserList){
							if(itemss.userId==item){
								newData.push(itemss.userId)
							}
						}
					});
					console.log(newData)
				}
				for(var item of arr){
					if (item.indexOf('date_') === 0) {
						let arrs = item.split('_');
						if(objss[arrs[1]]){
							obj[`${item}`] = moment(objss[arrs[1]])
						}
						// objss[arrs[1]] = moment(objss[arrs[1]],"YYYY-MM-DD");
						// obj[`${item}`] = objss[`${arrs[1]}`]
					}
					else if(item == `maintainPersons`){
						obj[`${item}`] = newData
					}
					else if(objss[`${item}`]){
						obj[`${item}`] = objss[`${item}`]
					}
				}
				setTimeout(() => {
					console.log(obj)
					this.props.form.setFieldsValue(obj)
					this.setState({spining:false,chooseData:objss})
				}, 50);
				this.setState({
					dataSource: dataaa.length===1 ? dataaa[0] : {},
					total:res.total,
					formValues:data
				});
			})
		}else if(id==='new'){
			this.setState({type:0,spining:false})
		}
	 };
	 zydw = () => {//租用单位列表
		this.get(euqApplicationName + '/parameter_setting_public/queryRentDepartmentList?type=2').then(res => {
			this.setState({
				zydw: res.data,
			});
		})
	   }
	
	   wldw = () => {//往来单位列表
		this.get(euqApplicationName + '/parameter_setting_public/queryRentDepartmentList?type=1').then(res => {
			this.setState({
				wldw: res.data,
			});
		})
	   }	
	   
	//   用户查询
	queryPageUser = () => {
		this.get(lotAuth2 + '/user/queryPageUser').then(res => {
			this.setState({
				UserList : res.data.data
			});
		})
	}
	 // 部门查询
	 
	 queryTreeDepartment = () => {
		//  this.get(lotAuth + '/department/queryTreeDepartment').then(res => {
			 this.get(lotAuth2 + '/department/queryTreeDepartment').then(res => {
			 this.setState({
				 DepartmentList : res.data
			 });
		 })
	 }
 
	 EquTypePageList = () => {
		 this.get(euqApplicationName + '/parameter_setting_equipmentType/findEquTypePageList').then(res1 => {
			 this.setState({
				 EquTypePageList : res1.data
			 });
		 })
	 }
	 wxz = () => {//维修组
		this.get(euqApplicationName + '/parameter_setting_public/queryTeamPageList?type=维修').then(res => {
		this.setState({
			 wxz: res.data,
		 });
		 })
	}; 
	jjcd = () => {//紧急程度列表
	   this.get(euqApplicationName + '/api/findEquipmentNextParameterPageList?typeId=8').then(res => {
	   this.setState({
		 jjcd: res.data,
		});
		})
   }; 
	wxlb = () => {//维修类别列表
	 this.get(euqApplicationName + '/api/findEquipmentNextParameterPageList?typeId=7').then(res => {
	 this.setState({
		wxlb: res.data,
	  });
	  })
 	}; 
	 
	 lastOperateIsChoose = () => {
		 console.log(this.state.equipmentRepairWorkAddDTOList)
		 const p = this
		 this.handleSubmit()
	 }
 
	 // 提交modal
	 // 提交modal
	 handleSubmit = () => {
		// 'equPosition''date_planExeTime','reminderTime','maintenanceCategoryId''urgencyId''maintainTeam''maintainPersons','maintainDays''maintainPerWorkHours''outsource''outsourceHours''remarks'
		 const { dataSource, chooseData , selectedDataTable,equipmentRepairWorkAddDTOList,type} = this.state;
		 const p = this;
		 const { form } = this.props;
		 form.validateFieldsAndScroll([ 'equPosition','date_planExeTime','reminderTime','maintenanceCategoryId','urgencyId','maintainTeam','maintainPersons','maintainDays','maintainPerWorkHours','outsource','outsourceHours','remarks'],(err, fieldsValue) => {
			 if (err) {
				 return;
			 }
			 for (var key in fieldsValue) {
				 //单个时间选择器--需要时分秒
				 if (key.indexOf('date_') === 0) {
					 if (fieldsValue[key]) {
						 let arr = key.split('_');
						 fieldsValue[arr[1]] = Utils.getDate(fieldsValue[key]);
					 }
					 delete fieldsValue[key];
				 }
			 }
			 let equInfoIdList = []
			 if(equipmentRepairWorkAddDTOList.length==0 && this.state.type===0){
				Utils.openNotification('warning','请添加设备！')
				return
			}
			 if(equipmentRepairWorkAddDTOList.length>0){
				 for(var item of equipmentRepairWorkAddDTOList){
					item.equTypeId = item.equTypeId ? Number(item.equTypeId) : null
					item.equId = item.id
				 }
			 }
			//  fieldsValue['maintainPersons'] = ''
			let news = []
			 if(fieldsValue['maintainPersons']&&fieldsValue['maintainPersons'].length){
				 let arr = fieldsValue['maintainPersons']
				 let list = this.state.UserList
				 arr.forEach(items=>{
				 	for(let item of list){
						if(items==item.userId){
							news.push({
								personId:item.userId,
								personName:item.userName,
								treatmentId: chooseData.treatmentId ? chooseData.treatmentId : null
							})
						}
					}
				})
				console.log(news)
				 let ss = fieldsValue['maintainPersons'].join(',')
				console.log(ss)
				 fieldsValue['maintainPersons'] = ss
				 news[0].perType = 0
				 for(var key in news){
					 if(key>0){
						 news[key].perType = 1
					 }
				 }
			 }
			 fieldsValue.equipmentRepairWorkAddDTOList = news.length>0 ? news : []
			 fieldsValue.maintainDays = fieldsValue.maintainDays ? Number(fieldsValue.maintainDays) : ''
			 fieldsValue.maintainPerWorkHours = fieldsValue.maintainPerWorkHours ? Number(fieldsValue.maintainPerWorkHours) : ''
			 fieldsValue.outsourceHours = fieldsValue.outsourceHours ? Number(fieldsValue.outsourceHours) : 0
			 console.log(fieldsValue['maintainPersons'])
			 fieldsValue['maintainPersons'] = fieldsValue['maintainPersons'] != [] ? fieldsValue['maintainPersons'] : ''
			 if(fieldsValue['maintainPersons'] && fieldsValue['maintainPersons'].length==0){
				fieldsValue['maintainPersons'] = ''
			 }
			//  fieldsValue['maintainPersons'] = fieldsValue['maintainPersons'] != undefined && fieldsValue['maintainPersons'].length> 0 ? fieldsValue['maintainPersons'] : 0

			//  fieldsValue.equId = selectedDataTable.length===1 ? selectedDataTable[0].id : chooseData.equId
			//  const id = this.state.chooseData && this.state.chooseData.id;
			//  if (id && this.state.handleType===1) {
			// 	 fieldsValue .id = id;
			// 	 fieldsValue.userId = localStorage.getItem('userId');
			//  } else {
			// }
			fieldsValue.userId = localStorage.getItem('userId');
			fieldsValue.equInfoList = equipmentRepairWorkAddDTOList
			if(type===1){
				fieldsValue.id = dataSource.planId
				fieldsValue.faultInformationId = dataSource.faultInforId
			}
			console.log(fieldsValue)
			this.post(euqApplicationName + '/equipmentRepairPlan/saveEquipmentRepairPlan', { data : fieldsValue }).then(res => {
				this.success();
				this.props.history.push('/MaintenancePlan')
			});
			});
		 
	 };
 
 
	 onTreeChange = () => { };
 
	 renderTreeNodes = (data, name, valueField) =>
	 // console.log(data, name, valueField)
		 data && data.map(item => {
			 if (item.children) {
				 return (
					 <TreeNode title={item[name]} key={item[valueField]} value={item[valueField]} dataRef={item}>
						 {this.renderTreeNodes(item.children, name, valueField)}
					 </TreeNode>
				 );
			 }
			 return <TreeNode key={item[valueField]} value={item[valueField]} title={item[name]} {...item} />;
		 });
 
	 chooseEqu = () => {
		 this.fetchTable({
			 pageNum: 1,
			 pageSize: 10
		 })
		 this.setState({visibleEqu : true})
	 }
	 choosePeo = () => {
		this.fetchTablePeo({
			pageNum: 1,
			pageSize: 10
		})
		this.setState({visiblePeo : true})
	}
 
	 fetchTable = (data) => {
		 let str = ''
		 for(var key in data){
			 if(data[key]){
				 str += `&${key}=${data[key]}`
			 }
		 }
		 this.setState({ loadingTable: true })
		 this.get(euqApplicationName + '/equipmentInfo/findEquInfoList?'+str).then(res => {
			 this.setState({
				 loadingTable: false,
				 tableData: res.data.data,
				 totalTable:res.data.total,
				 formValuesTable:data,
				 selectedKeysTable:[],
				 selectedDataTable:[],
			 });
		 })
	 }
	 fetchTablePeo = (data) => {
		let str = ''
		for(var key in data){
			if(data[key]){
				str += `&${key}=${data[key]}`
			}
		}
		this.setState({loadingTable:true})
		this.get(euqApplicationName + '/equipmentMaintain/findUserOfMaintain?'+str).then(res => {
			this.setState({
				loadingTable:false,
				peopleData: res.data,
				totalTablePeo:res.total,
				formValuesTablePeo:data,
				selectedKeysTablePeo:[],
				selectedDataTablePeo:[],
			});
		})
	}
 
	 closeModal = () => {
		 this.setState({visibleEqu:false,visiblePeo:false})
	 }
 
	 modalSubmit = () => {
		 if(this.state.selectedKeysTable.length!==1){
			 Utils.openNotification('warning','请（仅）选择一条数据！')
			 return;
		 }
		 let data = this.state.selectedDataTable[0]
		 // 'equCode', 'equName','equType','equSpecsModel','deptId','equPosition'
		 this.props.form.setFieldsValue({
			 equCode : data.equCode,
			 equName : data.equName,
			 equType : data.equTypeId,
			 equSpecsModel : data.equSpecsModel,
			 deptName : data.userDepartmentName,
			 equLocation : data.equipmentLocation,
		 })
		 this.closeModal()
	 }
	  
	 modalSubmitPeo = () => {
		if(this.state.selectedKeysTable.length===0){
			Utils.openNotification('warning','请选择数据！')
			return;
		}
		let {equipmentRepairWorkAddDTOList} = this.state
		let data = this.state.selectedDataTable
		for(var item of data){
			item.personId = item.id
			item.personName = item.userName
		}
		// 'repairStartTime' ,'repairEndTime' ,'wastedTime' ,'contentOrSteps',
		let newData = [...equipmentRepairWorkAddDTOList];
		console.log(newData)
		const ids = newData.map(item => item.id);
		data.forEach(item => {
			ids.indexOf(item.id) === -1 && newData.push({
				equCode: item.equCode,
				equName: item.equName,
				equSpecsModel: item.equSpecsModel,
				deptName: item.userDepartmentName,
				equLocation: item.equipmentLocation,
				equTypeName: item.equTypeName,
				id: item.id,
			});
		});
		console.log(newData)
		this.setState({
			equipmentRepairWorkAddDTOList:newData
		})
		this.closeModal()
	}
	 TableSearch = () => {
		 this.props.form.validateFields(['depId','equTypeId'],(err,values)=>{
			 if(!err){
				 console.log(values)
				 values.pageNum = this.state.formValuesTable.pageNum;
				 values.pageSize = this.state.formValuesTable.pageSize;
				 this.fetchTable(values);
			 }
		 })
	 }
	 TableSearchPeo = () => {
		this.props.form.validateFields(['department','userName'],(err,values)=>{
			if(!err){
				console.log(values)
				values.pageNum = this.state.formValuesTable.pageNum;
				values.pageSize = this.state.formValuesTable.pageSize;
				this.fetchTablePeo(values);
			}
		})
	}
 
		input1 = (e,record,index) => {
		   let {equipmentRepairWorkAddDTOList} = this.state
		   record.equLocation = e.target.value
		   console.log(e.target.value,record,index)
		}
		handleDelete = key => {
			const equipmentRepairWorkAddDTOList = [...this.state.equipmentRepairWorkAddDTOList];
			this.setState({ equipmentRepairWorkAddDTOList: equipmentRepairWorkAddDTOList.filter(item => item.id !== key) });
		};
		SwitchOnChange = (checked) => {
			this.setState({switchChecked:checked})
		}
		teamChange = (event) => {
			console.log(event)
			this.props.form.resetFields('maintainPersons')
			if(event==undefined){
				this.queryPageUser()
				return
			}else{
				this.props.form.resetFields('maintainPersons')
				const {wxz} = this.state
				wxz.forEach((item)=>{
					return item.id == event && this.setState({UserList:item.userIdList})
				})
			}

		}
		// DteamChange = (value) => {
		// 	console.log(value)
		// 	// this.props.form.resetFields('maintainPersons')
		// 	// const {wxz} = this.state
		// 	// wxz.forEach((item)=>{
		// 	// 	return item.id == value && this.setState({UserList:item.userIdList})
		// 	// })
		// }
	 render() {
		 const columns = [
			 {
				 title: '删除', width: 80, 
				 render: (text, record) => {
					 return <span><a href onClick={() => this.handleDelete(record.id)}>删除</a></span>
				 }
			 },
			 { title: '设备编号', width: 150, dataIndex: 'equCode' },
			 { title: '设备名称', width: 150, dataIndex: 'equName'},
			 { title: '规格型号', width: 150, dataIndex: 'equSpecsModel' },
			 { title: '设备类型', width: 150, dataIndex: 'equTypeName' },
			 { title: '使用部门', width: 200, dataIndex: 'deptName' },
			 { title: '设备位置', width: 150, dataIndex: 'equLocation',render:(text,record,index)=>{
				return <Input defaultValue={text ? text : ''} onBlur={(e)=>this.input1(e,record,index)} onPressEnter={(e)=>this.input1(e,record,index)}/>
			} },
		 ];
 
		 const column = [
			 { title: '设备编码', width: 150, dataIndex: 'equCode' },
			 { title: '设备名称', width: 150, dataIndex: 'equName' },
			 { title: '规格型号', width: 150, dataIndex: 'equSpecsModel' },
			 { title: '使用部门', width: 150, dataIndex: 'userDepartmentName' },
			 { title: '设备类别', width: 150, dataIndex: 'equTypeName' },
			 { title: '设备位置', width: 150, dataIndex: 'equipmentLocation' },
		 ]
		 const columnPeo = [
			{ title: '名称', width: 150, dataIndex: 'userName' },
			{ title: '职务', width: 150, dataIndex: 'roleName' },
			{ title: '使用部门', width: 150, dataIndex: 'department' },
			{ title: '执行班组', width: 150, dataIndex: 'teamName' },
		 ]
		 const {  loading,visibleEqu ,totalTable ,formValuesTable ,loadingTable ,selectedKeysTable ,visiblePeo ,equipmentRepairWorkAddDTOList,selectedKeysTablePeo,selectedDataTablePeo,formValuesTablePeo,totalTablePeo,peopleData} = this.state;
		 const {  EquTypePageList ,gzdj ,gzlb , DepartmentList , jjcd ,wxz ,wxjb ,wxlb,wxzt,gzyy , zydw , wldw,UserList} = this.state;
 
		 //选择框
		 const rowSelectionTablePeo = {
			 selectedRowKeys: selectedKeysTablePeo,
			 onChange: (selectedRowKeys, selectedRows) => {
				 this.setState({
					 selectedDataTablePeo: selectedRows,
					 selectedKeysTablePeo: selectedRowKeys
				 })
			 },
		 };
 
		 const rowSelectionTable = {
			 selectedRowKeys: selectedKeysTable,
			 onChange: (selectedRowKeys, selectedRows) => {
				 this.setState({
					 selectedDataTable: selectedRows,
					 selectedKeysTable: selectedRowKeys
				 })
			 },
		 }
		 const { getFieldDecorator}=this.props.form
		 const p = this
		 const modalProps = {
			 title:"选择设备",
			 visible:visibleEqu,
			 width : '780px',
			 onCancel() {
			   p.closeModal();
			 },
			 okText:'保存',
			 cancelText:'取消',
			 onOk(){
			   p.modalSubmitPeo();
			 }
		   };
		const wwdw = zydw.concat(wldw)
		 return (
			<div className="shadow-radius">
				<Spin spinning={this.state.spining}>
				<Modal {...modalProps}>
					<Form  {... {labelCol: {xs: { span: 30 },sm: { span:6 },},wrapperCol: {xs: {span: 24},sm: {span: 14}}}}>
					<Row gutter={24}>
						<Col span={10}>
								<Form.Item label="设备类别">
									{getFieldDecorator('equTypeId')(
										<TreeSelect onChange={this.onTreeChange} placeholder={'请选择设备类别'} showCheckedStrategy="SHOW_PARENT" treeCheckable={false}  allowClear>
										{this.renderTreeNodes(EquTypePageList, 'name', 'id')}
										</TreeSelect>)}
								</Form.Item>
						</Col>
						<Col span={10}>
								<Form.Item label="所在部门">
									{getFieldDecorator('depId',)(
										<Select allowClear placeholder='请输入所在部门'>
												{DepartmentList.map(item=><Option value={item.id}>{item.name}</Option>)}
										</Select>)}
								</Form.Item>
						</Col>
						<Col span={4}>
							<Button type="primary" onClick={()=>{this.TableSearch()}}>查询</Button>
						</Col>
					</Row>
					</Form>	
						<Table columns={column} dataSource={p.state.tableData} pagination={false} loading={loadingTable}  rowSelection={rowSelectionTable} rowKey={(record, index) => record.id}  childrenColumnName={''} />
						<Paging total={totalTable} formValues={formValuesTable} fetch={pager => this.fetchTable(pager)} />
				</Modal>
				<div style={{width:'100%'}}>
					<div >
					<Form {...{ labelCol: { xs: { span: 6 }, sm: { span: 8},},	wrapperCol: { xs: { span: 12 }, sm: { span: 16 }, }}}>
						{/* <Row gutter={24} style={{width:1400,margin:'0 auto'}}>
							<Col span={6}>
								<Button type="primary" onClick={()=>{this.chooseEqu()}} >选择设备</Button>
							</Col>
						</Row> */}
						<div style={{width:'100%',display:this.state.type===0 ? 'block' : 'none'}}>
							<div style={{width:1400,margin:'0 auto'}}>
								<Button icon="plus" type="primary" onClick={this.chooseEqu}>选择设备</Button>
								<Table columns={columns} rowKey={(record, index) => index} dataSource={equipmentRepairWorkAddDTOList} pagination={false} loading={loading} scroll={{ y: 450 ,x:1200}} />
							</div>
						</div>
						<h2 style={{fontSize:16,color:'#0067B8',fontWeight:600,display:this.state.type===1 ? 'block' : 'none'}}>设备信息</h2>
						<div style={{display:this.state.type===1 ? 'block' : 'none'}}>
							<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
								<Col span={6}>
									<Form.Item label="设备编号">
									{getFieldDecorator('equCode', )(<Input allowClear placeholder='请输入设备编号' disabled={true}/>)}
									</Form.Item>
								</Col>
								<Col span={6}>
									<Form.Item label="设备名称">
									{getFieldDecorator('equName',)(
										<Input allowClear placeholder='请输入设备名称' disabled={true}/>)}
									</Form.Item>
								</Col>
								<Col span={6}>
									<Form.Item label="规格型号">
										{getFieldDecorator('equSpecsModel',)(
										<Input allowClear placeholder='请输入规格型号' disabled={true}/>)}
									</Form.Item>
								</Col>
								<Col span={6}>
									<Form.Item label="设备类别">
										{getFieldDecorator('equTypeName')(
										<Input allowClear placeholder='请输入设备类别' disabled={true}/>)}
									</Form.Item>
								</Col>
							</Row>
							<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
								<Col span={6}>
									<Form.Item label="使用部门">
										{getFieldDecorator('deptName',)(
												<Input allowClear placeholder='请输入使用部门' disabled={true}/>)}
									</Form.Item>
								</Col>
								<Col span={6}>
									<Form.Item label="操作人">
										{getFieldDecorator('personName',)(
												<Input allowClear placeholder='请输入操作人' disabled={true}/>)}
									</Form.Item>
								</Col>
								<Col span={6}>
									<Form.Item label="设备位置">
										{getFieldDecorator('equLocation')(<Input allowClear placeholder='请输入设备位置' disabled={true}/>)}
									</Form.Item>
								</Col>
							</Row>
						</div>
						<h2 style={{fontSize:16,color:'#0067B8',fontWeight:600}}>维修信息</h2>
						<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
							<Col span={6}>
								<Form.Item label="计划执行时间">
									{getFieldDecorator('date_planExeTime',{ rules: [{	required: true,	message: '请输入计划执行时间'}]})(<DatePicker disabled={true} allowClear placeholder='yyyy-MM-dd' style={{width:210}} />)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="提醒时间" >
									{getFieldDecorator('reminderTime',{ rules: [{	required: true,	message: '请填写提醒时间'}]})(<Input disabled={true} allowClear placeholder='单位为天'/>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="维修类别">
									{getFieldDecorator('maintenanceCategoryId')(<Select allowClear placeholder='请输入维修类别' disabled={true}>
											{wxlb.map(item=><Option value={item.id}>{item.configValue}</Option>)}
									</Select>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="紧急程度">
								{getFieldDecorator('urgencyId')(<Select allowClear placeholder='请输入紧急程度' disabled={true}>
										{jjcd.map(item=><Option value={item.id}>{item.configValue}</Option>)}
								</Select>)}
								</Form.Item>
							</Col>
						</Row>
						{/* <h2 style={{fontSize:16,color:'#0067B8',fontWeight:600}}>处理情况</h2> */}
						<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
							<Col span={6}>
								<Form.Item label="维修组">
									{getFieldDecorator('maintainTeam')(<Select allowClear placeholder='请输入维修组' disabled={true} onChange={this.teamChange}>
											{wxz.map(item=><Option value={item.id}>{item.name}</Option>)}
									</Select>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="维修人员">
									{getFieldDecorator('maintainPersons',)(<Select mode="multiple" allowClear placeholder='请输入维修人员' disabled={true}>
										{UserList.map(item=><Option value={item.userId}>{item.userName}</Option>)}
									</Select>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="工作天数">
									{getFieldDecorator('maintainDays')(<Input placeholder='请输入工作天数' allowClear disabled={true}/>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="人均工时/天">
									{getFieldDecorator('maintainPerWorkHours')(<Input placeholder='请输入人均工时/天' allowClear disabled={true}/>)}
								</Form.Item>
							</Col>
						</Row>
						<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
							<Col span={6}>
								<Form.Item label="外委单位">
									{/* wu */}
									{getFieldDecorator('outsource')(<Select allowClear placeholder='请输入外委单位'disabled={true}>
										{wwdw.map(item=><Option value={item.id}>{item.name}</Option>)}
									</Select>)}
								</Form.Item>
							</Col>
							<Col span={6}>
								<Form.Item label="外协工时">
									{getFieldDecorator('outsourceHours')(<Input placeholder='请输入外协工时' allowClear disabled={true}/>)}
								</Form.Item>
							</Col>
						</Row>
						<Row gutter={24} style={{width:1400,margin:'0 auto'}}>
							<Col span={6}>
								<Form.Item label="描述">
									{getFieldDecorator('remarks')(<TextArea allowClear placeholder='请输入工作描述' style={{width:560,height:80}}disabled={true}/>)}
								</Form.Item>
							</Col>
						</Row>
						
					</Form>
						{/* <h2 style={{fontSize:16,color:'#0067B8',fontWeight:600}}>维修工作量</h2>
						<div style={{width:'100%'}}>
							<div style={{width:1400,margin:'0 auto'}}>
								<Button icon="plus" type="primary" onClick={this.choosePeo}>添加人员</Button>
								<Table columns={columns} rowKey={(record, index) => index} dataSource={equipmentRepairWorkAddDTOList} pagination={false} loading={loading} scroll={{ y: 450 ,x:1200}} />
							</div>
						</div> */}
						{/* <h2 style={{fontSize:16,color:'#0067B8',fontWeight:600}}>更换备件</h2> */}
						{/* <Paging total={total} formValues={formValues} fetch={pager => this.fetch(pager)} /> */}
						{/* <Table columns={columns1} rowSelection={rowSelection} rowKey={(record, index) => index} dataSource={dataSource1} pagination={false} loading={loading} scroll={{ y: 250 }} /> */}
						{/* <Paging total={total} formValues={formValues} fetch={pager => this.fetch(pager)} /> */}
						<div style={{width:'100%',marginTop:100}}>
							<div style={{margin:'0 auto',width:'400px'}}>
								{/* <Button icon="check" onClick={this.lastOperateIsChoose} type="primary" style={{marginRight: 38,}}>保存</Button> */}
								<Button onClick={()=>{this.props.history.push('/MaintenancePlan')}} icon="close">返回</Button>
							</div>
						</div>
					</div>
				</div>
				</Spin>
			</div>
		 );
	 }
 }
 export default Form.create()(withRouter(App));
 